package com.bright.service.Impl;

import com.bright.dao.Impl.OssDaoImpl;
import com.bright.dao.OssDao;
import com.bright.entity.Oss;
import com.bright.service.OssService;

import java.util.List;

public class OssServiceImpl implements OssService {
    OssDao ossDao = new OssDaoImpl();
    @Override
    public List<Oss> selectAll() {
        return ossDao.selectAll();
    }

    @Override
    public Oss selectByName(String name) {
        return ossDao.selectByName(name);
    }

    @Override
    public boolean insert(Oss oss) {
        int num = ossDao.insert(oss);
        if(num>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean update(String name, String permission) {
        int num = ossDao.updatePermission(name,permission);
        if(num>0){
            return true;
        }
        return false;
    }
}
